package com.miaoxun.dao;

import com.basemapper.BasicMapper;
import com.miaoxun.dao.provider.UserProvider;
import com.miaoxun.domain.entity.User;
import com.miaoxun.domain.model.UserModel;
import com.miaoxun.domain.param.UserParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author ruoshuisixue
 * @email ruoshuisixue@sina.com
 * @date 2017-11-17 14:38:42
 */
@Mapper
@Component
public interface UserMapper extends BasicMapper<User> {



    @SelectProvider(type = UserProvider.class, method = "listByDept")
    List<User> listByDept(UserParam param);

    /**
     * 通过用户名取用户
     * @param userName
     * @return
     */
    @SelectProvider(type = UserProvider.class, method = "findByUsername")
    User findByUsername(String userName);

    @SelectProvider(type = UserProvider.class, method = "findUserDeptById")
    UserModel findUserDeptById(Long id);
}
